<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery-3.3.1.js"></script>
</head>
<script type="application/javascript">
    function clickFn() {
        $.ajax({
            url:"s2",
            async:true,
            data:"username=bingbing&password=456",
            type:"post",
            dataType:"text",
            success:function (data) {
                alert(data)
            },
            error:function () {
                alert("服务器发生了错误")
            }
        });
    }

</script>
<body>
<!--设计一个按钮，一点击这个按钮，就向服务器发出异步请求-->
<input type="button" value="点我，发出ajax异步请求" onclick="clickFn()"/>
</body>
</html>